package com.hd.boot0407.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVo {
    private  String code;
    private  String message;
    private  String ex;
    public static ResultVo error(){
        ResultVo resultVo = new ResultVo();

        resultVo.setCode("-1");
        resultVo.setMessage("操作失败");

        return resultVo;
    }

    public static ResultVo error(String msg){
        ResultVo resultVo = new ResultVo();

        resultVo.setCode("-1");
        resultVo.setMessage(msg);

        return resultVo;
    }


    public static ResultVo ok(){

        ResultVo resultVo = new ResultVo();

        resultVo.setCode("1");
        resultVo.setMessage("操作成功");

        return resultVo;

    }

    public static ResultVo ok(String msg){
        ResultVo resultVo = new ResultVo();

        resultVo.setCode("1");
        resultVo.setMessage(msg);

        return resultVo;
    }

}
